<?xml version="1.0" encoding="utf-8" ?>
<sqlMap namespace='WorkUnit' xmlns='http://ibatis.apache.org/mapping' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
  <alias>
    <typeAlias alias='WorkUnit' assembly='Janus.Mes.POCO.dll' type='Janus.Mes.POCO.WorkUnit' />
  </alias>
  <resultMaps>
    <resultMap id='WorkUnitResult' class='WorkUnit'>
	<result property='Id' column='Id' /> 
	<result property='wUnitCode' column='wUnitCode' /> 
	<result property='WorkCCode' column='WorkCCode' /> 
	<result property='wUnitName' column='wUnitName' /> 
	<result property='wUnitCat' column='wUnitCat' /> 
	<result property='EquCode' column='EquCode' /> 
	<result property='MacLoadQty' column='MacLoadQty' /> 
	<result property='MacLoadHour' column='MacLoadHour' /> 
	<result property='ManLoadQty' column='ManLoadQty' /> 
	<result property='ManLoadHour' column='ManLoadHour' /> 
	<result property='MacCost' column='MacCost' /> 
	<result property='ManCost' column='ManCost' /> 
	<result property='DayWeek' column='DayWeek' /> 
	<result property='HourWeekMac' column='HourWeekMac' /> 
	<result property='HourWeekMan' column='HourWeekMan' /> 
	<result property='Remark' column='Remark' /> 
	<result property='Creator' column='Creator' /> 
	<result property='CreateDate' column='CreateDate' /> 
	<result property='Updater' column='Updater' /> 
	<result property='UpdateDate' column='UpdateDate' /> 
	<result property='IsDelete' column='IsDelete' /> 
	<result property='CreatorCode' column='CreatorCode' /> 
	<result property='UpdaterCode' column='UpdaterCode' /> 
	<result property='OperDept' column='OperDept' /> 
	<result property='Timestamp' column='Timestamp' /> 
		</resultMap>
  </resultMaps>  
  <statements>
  <sql id="UpdaterConditions">  
  <dynamic prepend="SET">
        	<isPropertyAvailable prepend="" property="WorkCCode">
        <isNotEmpty prepend="," property="WorkCCode">
		          [WorkCCode]=#WorkCCode#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="wUnitName">
        <isNotEmpty prepend="," property="wUnitName">
		          [wUnitName]=#wUnitName#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="wUnitCat">
        <isNotEmpty prepend="," property="wUnitCat">
		          [wUnitCat]=#wUnitCat#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="EquCode">
        <isNotEmpty prepend="," property="EquCode">
		          [EquCode]=#EquCode#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="MacLoadQty">
        <isNotEmpty prepend="," property="MacLoadQty">
		          [MacLoadQty]=#MacLoadQty#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="MacLoadHour">
        <isNotEmpty prepend="," property="MacLoadHour">
		          [MacLoadHour]=#MacLoadHour#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="ManLoadQty">
        <isNotEmpty prepend="," property="ManLoadQty">
		          [ManLoadQty]=#ManLoadQty#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="ManLoadHour">
        <isNotEmpty prepend="," property="ManLoadHour">
		          [ManLoadHour]=#ManLoadHour#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="MacCost">
        <isNotEmpty prepend="," property="MacCost">
		          [MacCost]=#MacCost#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="ManCost">
        <isNotEmpty prepend="," property="ManCost">
		          [ManCost]=#ManCost#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="DayWeek">
        <isNotEmpty prepend="," property="DayWeek">
		          [DayWeek]=#DayWeek#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="HourWeekMac">
        <isNotEmpty prepend="," property="HourWeekMac">
		          [HourWeekMac]=#HourWeekMac#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="HourWeekMan">
        <isNotEmpty prepend="," property="HourWeekMan">
		          [HourWeekMan]=#HourWeekMan#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="Remark">
        <isNotEmpty prepend="," property="Remark">
		          [Remark]=#Remark#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="Creator">
        <isNotEmpty prepend="," property="Creator">
		          [Creator]=#Creator#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="CreateDate">
        <isNotEmpty prepend="" property="CreateDate">
				  <isNotEqual prepend="," property="CreateDate" compareValue="1900-01-01">
		          [CreateDate]=#CreateDate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="Updater">
        <isNotEmpty prepend="," property="Updater">
		          [Updater]=#Updater#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="UpdateDate">
        <isNotEmpty prepend="" property="UpdateDate">
				  <isNotEqual prepend="," property="UpdateDate" compareValue="1900-01-01">
		          [UpdateDate]=#UpdateDate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="IsDelete">
        <isNotEmpty prepend="" property="IsDelete">
				  <isNotEqual prepend="," property="IsDelete" compareValue="0">
		          [IsDelete]=#IsDelete#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="CreatorCode">
        <isNotEmpty prepend="," property="CreatorCode">
		          [CreatorCode]=#CreatorCode#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="UpdaterCode">
        <isNotEmpty prepend="," property="UpdaterCode">
		          [UpdaterCode]=#UpdaterCode#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="OperDept">
        <isNotEmpty prepend="," property="OperDept">
		          [OperDept]=#OperDept#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	 </dynamic>
    </sql>
	<sql id="WhereConditions">
	 <dynamic prepend="WHERE">
	 	 <isPropertyAvailable prepend="" property="Id">
        <isNotEmpty prepend="AND" property="Id">
		          [Id]=#Id#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="wUnitCode">
        <isNotEmpty prepend="AND" property="wUnitCode">
		          [wUnitCode]=#wUnitCode#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="WorkCCode">
        <isNotEmpty prepend="AND" property="WorkCCode">
		          [WorkCCode]=#WorkCCode#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="wUnitName">
        <isNotEmpty prepend="AND" property="wUnitName">
		          [wUnitName]=#wUnitName#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="wUnitCat">
        <isNotEmpty prepend="AND" property="wUnitCat">
		          [wUnitCat]=#wUnitCat#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="EquCode">
        <isNotEmpty prepend="AND" property="EquCode">
		          [EquCode]=#EquCode#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="MacLoadQty">
        <isNotEmpty prepend="AND" property="MacLoadQty">
		          [MacLoadQty]=#MacLoadQty#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="MacLoadHour">
        <isNotEmpty prepend="AND" property="MacLoadHour">
		          [MacLoadHour]=#MacLoadHour#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="ManLoadQty">
        <isNotEmpty prepend="AND" property="ManLoadQty">
		          [ManLoadQty]=#ManLoadQty#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="ManLoadHour">
        <isNotEmpty prepend="AND" property="ManLoadHour">
		          [ManLoadHour]=#ManLoadHour#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="MacCost">
        <isNotEmpty prepend="AND" property="MacCost">
		          [MacCost]=#MacCost#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="ManCost">
        <isNotEmpty prepend="AND" property="ManCost">
		          [ManCost]=#ManCost#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="DayWeek">
        <isNotEmpty prepend="AND" property="DayWeek">
		          [DayWeek]=#DayWeek#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="HourWeekMac">
        <isNotEmpty prepend="AND" property="HourWeekMac">
		          [HourWeekMac]=#HourWeekMac#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="HourWeekMan">
        <isNotEmpty prepend="AND" property="HourWeekMan">
		          [HourWeekMan]=#HourWeekMan#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Remark">
        <isNotEmpty prepend="AND" property="Remark">
		          [Remark]=#Remark#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Creator">
        <isNotEmpty prepend="AND" property="Creator">
		          [Creator]=#Creator#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="CreateDate">
        <isNotEmpty prepend="" property="CreateDate">
				  <isNotEqual prepend="AND" property="CreateDate" compareValue="1900-01-01">
		          [CreateDate]=#CreateDate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Updater">
        <isNotEmpty prepend="AND" property="Updater">
		          [Updater]=#Updater#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="UpdateDate">
        <isNotEmpty prepend="" property="UpdateDate">
				  <isNotEqual prepend="AND" property="UpdateDate" compareValue="1900-01-01">
		          [UpdateDate]=#UpdateDate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="IsDelete">
        <isNotEmpty prepend="" property="IsDelete">
				  <isNotEqual prepend="AND" property="IsDelete" compareValue="0">
		          [IsDelete]=#IsDelete#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="CreatorCode">
        <isNotEmpty prepend="AND" property="CreatorCode">
		          [CreatorCode]=#CreatorCode#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="UpdaterCode">
        <isNotEmpty prepend="AND" property="UpdaterCode">
		          [UpdaterCode]=#UpdaterCode#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="OperDept">
        <isNotEmpty prepend="AND" property="OperDept">
		          [OperDept]=#OperDept#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Timestamp">
        <isNotEmpty prepend="" property="Timestamp">
				  <isNotEqual prepend="AND" property="Timestamp" compareValue="1900-01-01">
		          [Timestamp]=#Timestamp#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  </dynamic> 
    </sql>
	<sql id="InsertPublic">
      INSERT INTO WorkUnit(
	     <dynamic prepend=" ">
       	   <isPropertyAvailable prepend="" property="Id">
        <isNotEmpty prepend="," property="Id">
          [Id]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="wUnitCode">
        <isNotEmpty prepend="," property="wUnitCode">
          [wUnitCode]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="WorkCCode">
        <isNotEmpty prepend="," property="WorkCCode">
          [WorkCCode]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="wUnitName">
        <isNotEmpty prepend="," property="wUnitName">
          [wUnitName]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="wUnitCat">
        <isNotEmpty prepend="," property="wUnitCat">
          [wUnitCat]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="EquCode">
        <isNotEmpty prepend="," property="EquCode">
          [EquCode]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="MacLoadQty">
        <isNotEmpty prepend="," property="MacLoadQty">
          [MacLoadQty]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="MacLoadHour">
        <isNotEmpty prepend="," property="MacLoadHour">
          [MacLoadHour]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="ManLoadQty">
        <isNotEmpty prepend="," property="ManLoadQty">
          [ManLoadQty]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="ManLoadHour">
        <isNotEmpty prepend="," property="ManLoadHour">
          [ManLoadHour]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="MacCost">
        <isNotEmpty prepend="," property="MacCost">
          [MacCost]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="ManCost">
        <isNotEmpty prepend="," property="ManCost">
          [ManCost]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="DayWeek">
        <isNotEmpty prepend="," property="DayWeek">
          [DayWeek]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="HourWeekMac">
        <isNotEmpty prepend="," property="HourWeekMac">
          [HourWeekMac]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="HourWeekMan">
        <isNotEmpty prepend="," property="HourWeekMan">
          [HourWeekMan]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Remark">
        <isNotEmpty prepend="," property="Remark">
          [Remark]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Creator">
        <isNotEmpty prepend="," property="Creator">
          [Creator]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="CreateDate">
        <isNotEmpty prepend="," property="CreateDate">
          [CreateDate]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Updater">
        <isNotEmpty prepend="," property="Updater">
          [Updater]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="UpdateDate">
        <isNotEmpty prepend="," property="UpdateDate">
          [UpdateDate]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="IsDelete">
        <isNotEmpty prepend="," property="IsDelete">
          [IsDelete]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="CreatorCode">
        <isNotEmpty prepend="," property="CreatorCode">
          [CreatorCode]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="UpdaterCode">
        <isNotEmpty prepend="," property="UpdaterCode">
          [UpdaterCode]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="OperDept">
        <isNotEmpty prepend="," property="OperDept">
          [OperDept]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Timestamp">
        <isNotEmpty prepend="," property="Timestamp">
          [Timestamp]
        </isNotEmpty>
      </isPropertyAvailable>
	  </dynamic>
      )
      VALUES
      (
	   <dynamic prepend=" ">
      	<isPropertyAvailable prepend="" property="Id">
        <isNotEmpty prepend="," property="Id">		
         #Id#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="wUnitCode">
        <isNotEmpty prepend="," property="wUnitCode">		
         #wUnitCode#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="WorkCCode">
        <isNotEmpty prepend="," property="WorkCCode">		
         #WorkCCode#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="wUnitName">
        <isNotEmpty prepend="," property="wUnitName">		
         #wUnitName#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="wUnitCat">
        <isNotEmpty prepend="," property="wUnitCat">		
         #wUnitCat#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="EquCode">
        <isNotEmpty prepend="," property="EquCode">		
         #EquCode#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="MacLoadQty">
        <isNotEmpty prepend="," property="MacLoadQty">		
         #MacLoadQty#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="MacLoadHour">
        <isNotEmpty prepend="," property="MacLoadHour">		
         #MacLoadHour#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="ManLoadQty">
        <isNotEmpty prepend="," property="ManLoadQty">		
         #ManLoadQty#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="ManLoadHour">
        <isNotEmpty prepend="," property="ManLoadHour">		
         #ManLoadHour#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="MacCost">
        <isNotEmpty prepend="," property="MacCost">		
         #MacCost#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="ManCost">
        <isNotEmpty prepend="," property="ManCost">		
         #ManCost#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="DayWeek">
        <isNotEmpty prepend="," property="DayWeek">		
         #DayWeek#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="HourWeekMac">
        <isNotEmpty prepend="," property="HourWeekMac">		
         #HourWeekMac#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="HourWeekMan">
        <isNotEmpty prepend="," property="HourWeekMan">		
         #HourWeekMan#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Remark">
        <isNotEmpty prepend="," property="Remark">		
         #Remark#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Creator">
        <isNotEmpty prepend="," property="Creator">		
         #Creator#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="CreateDate">
        <isNotEmpty prepend="," property="CreateDate">		
         #CreateDate#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Updater">
        <isNotEmpty prepend="," property="Updater">		
         #Updater#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="UpdateDate">
        <isNotEmpty prepend="," property="UpdateDate">		
         #UpdateDate#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="IsDelete">
        <isNotEmpty prepend="," property="IsDelete">		
         #IsDelete#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="CreatorCode">
        <isNotEmpty prepend="," property="CreatorCode">		
         #CreatorCode#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="UpdaterCode">
        <isNotEmpty prepend="," property="UpdaterCode">		
         #UpdaterCode#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="OperDept">
        <isNotEmpty prepend="," property="OperDept">		
         #OperDept#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Timestamp">
        <isNotEmpty prepend="," property="Timestamp">		
         #Timestamp#		
        </isNotEmpty>
      </isPropertyAvailable>
	  </dynamic>
      )
    </sql>
	<!-- Insert statement:新增Mapper-->
    <insert id='Insert' parameterClass='WorkUnit'>
      <include refid="InsertPublic"/>
    </insert>
    <!--Update statement:修改Mapper-->
    <update id='Update' parameterClass='WorkUnit'>
      UPDATE [WorkUnit] 
      <include refid="UpdaterConditions"/>
      WHERE 1=1
	  	  AND wUnitCode=#wUnitCode#
	      </update>
    <update id='UpdateSetion' parameterClass='hashtable'>
      UPDATE [WorkUnit] 
      <include refid="UpdaterConditions"/>
      WHERE $conditions$
    </update>
	<update id='Save' parameterClass='WorkUnit'>
      IF NOT EXISTS(SELECT 1 FROM [WorkUnit] WHERE 1=1  AND [wUnitCode]=#wUnitCode# )
      BEGIN
      <include refid="InsertPublic"/>
      END
      ELSE
      BEGIN
      UPDATE WorkUnit 
      <include refid="UpdaterConditions"/>
      WHERE  1=1
	  	  AND [wUnitCode]=#wUnitCode#
	        END
    </update>
	<delete id='Delete' parameterClass='hashtable'>
      DELETE FROM [WorkUnit] WHERE	  
        <![CDATA[  
	 [wUnitCode]=#pk0# 
        ]]>
    </delete>
    <delete id='DeleteWhere' parameterClass='string'>
      DELETE FROM [WorkUnit] WHERE $value$
    </delete>

    <!-- select by key statement:-->
    <select id='FindOne' parameterClass='hashtable' resultClass='WorkUnit'>
      SELECT * FROM WorkUnit WHERE      
        <![CDATA[
		[wUnitCode]=#pk0# 
        ]]>
    </select>
    <select id='FindAllCondition' parameterClass='string' resultClass='WorkUnit'>
      SELECT * FROM [WorkUnit] WHERE $value$
    </select>
    <select id='FindScalar' parameterClass='hashtable' resultClass='WorkUnit'>
      SELECT * FROM [WorkUnit] WHERE $conditions$
    </select>
    
    <select id='FindAllCount' parameterClass='string' resultClass='int'>
      SELECT COUNT(1) FROM [WorkUnit] WHERE $value$
    </select>
    <select id='FindByPage' parameterClass='string' resultClass='WorkUnit'>
      SELECT * FROM [WorkUnit] WHERE $value$
    </select>
  </statements>
</sqlMap>
